#module名称
set(MODULE_NAME "learn_jsoncpp")
include_directories(${CMAKE_SOURCE_DIR}/3rd_part/jsoncpp/include)

set(MODULE_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(MODULE_INC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(MODULE_TST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tests)

#把目录下的c和c++所有源文件分别保存在变量中
file(GLOB_RECURSE
    SOURCES
    ${MODULE_SRC_PATH}/*.c
    ${MODULE_SRC_PATH}/*.cxx
    ${MODULE_SRC_PATH}/*.cpp
    ${MODULE_SRC_PATH}/*.cc
    ${MODULE_SRC_PATH}/*.h
    ${MODULE_SRC_PATH}/*.hxx
    ${MODULE_SRC_PATH}/*.hpp
)
file(GLOB_RECURSE
    INCLUDES
    ${MODULE_INC_PATH}/*.h
    ${MODULE_INC_PATH}/*.hxx
    ${MODULE_INC_PATH}/*.hpp
)

add_executable(${MODULE_NAME} ${SOURCES} ${INCLUDES})
target_include_directories(${MODULE_NAME} PUBLIC ${MODULE_INC_PATH})
target_link_libraries(${MODULE_NAME} jsoncpp)
